package com.thinkgsp.jxc.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.thinkgsp.util.XlsFieldAnnotation;

/**
 * ProductBusProperties 是 Product的业务扩展类，主要包含产品的业务信息，如价格等
 * @author evan
 *
 */
public class ProductBusProperties extends BaseModel implements Serializable {

	private static final long serialVersionUID = -3291172917998223289L;
	
	private Integer productId;					//Required
	private BigDecimal lastPrice;
	private Integer lastSupper;
	private Date lastIncomeDate;
	@XlsFieldAnnotation(ChsName="零售价",MethodName="getRetailPrice")
	private BigDecimal retailPrice;
	private BigDecimal refRetailPrice;
	private BigDecimal transferPrice;
	@XlsFieldAnnotation(ChsName="批发价",MethodName="getSalePrice")
	private BigDecimal salePrice;
	private BigDecimal costPrice;				//Required
		

	/**
	 * 产品ID
	 * @return
	 */
	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	/**
	 * 最后进价
	 * @return
	 */
	public BigDecimal getLastPrice() {
		return lastPrice;
	}

	public void setLastPrice(BigDecimal lastPrice) {
		this.lastPrice = lastPrice;
	}

	/**
	 * 最后供货商
	 * @return
	 */
	public Integer getLastSupper() {
		return lastSupper;
	}

	public void setLastSupper(Integer lastSupper) {
		this.lastSupper = lastSupper;
	}

	/**
	 * 最后到货日期
	 * @return
	 */
	public Date getLastIncomeDate() {
		return lastIncomeDate;
	}

	public void setLastIncomeDate(Date lastIncomeDate) {
		this.lastIncomeDate = lastIncomeDate;
	}

	/**
	 * 门店零售价
	 * @return
	 */
	
	public BigDecimal getRetailPrice() {
		return retailPrice;
	}

	public void setRetailPrice(BigDecimal retailPrice) {
		this.retailPrice = retailPrice;
	}

	/**
	 * 参考零售价 
	 * 本属性主要针对批发客户
	 * @return
	 */
	public BigDecimal getRefRetailPrice() {
		return refRetailPrice;
	}

	public void setRefRetailPrice(BigDecimal refRetailPrice) {
		this.refRetailPrice = refRetailPrice;
	}

	/**
	 * 门店调拨价
	 * @return
	 */
	public BigDecimal getTransferPrice() {
		return transferPrice;
	}

	public void setTransferPrice(BigDecimal transferPrice) {
		this.transferPrice = transferPrice;
	}

	/**
	 * 批发价
	 * @return
	 */
	public BigDecimal getSalePrice() {
		return salePrice;
	}

	public void setSalePrice(BigDecimal salePrice) {
		this.salePrice = salePrice;
	}

	/**
	 * 成本价
	 * 在产品初始化是使用
	 * @return
	 */
	public BigDecimal getCostPrice() {
		return costPrice;
	}

	public void setCostPrice(BigDecimal costPrice) {
		this.costPrice = costPrice;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		sb.append("BusProperties [ ")
		  .append("retailPrice",this.retailPrice)
		  .append("refRetailPrice",this.refRetailPrice)
		  .append("salePrice",this.salePrice)
		  .append("]");
		
		return sb.toString();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object o) {
		if(this == o) {
			return true;
		}
		if(!(o instanceof ProductBusProperties)) {
			return false;
		}
		final ProductBusProperties pbp = (ProductBusProperties)o;
		if(productId != null) {
			return productId.equals(pbp.getProductId());
		} else {
			return pbp.getProductId() == null;
		}
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		return (this.productId != null ? this.productId.hashCode() : 0);
	}

}
